UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GgCFfYkBj06uV/d0mcie2blBklmIf3ZFrkiA0gmbHWI=' 
WHERE 
  key_id = '9c8a960de64ab866f20fa6c8aead9aa0a38388ec482fde40cfe6dff11b858b4c' 
  AND (
    token = 'GgCFfYkBj06uV/d0mcie2blBklmIf3ZFrkiA0gmbHWI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033