UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c8OWDrwFkRvBb5yaLVrKvJzmk3TMTmc6ccrXK/IQL3c=' 
WHERE 
  key_id = 'ccc9378e95eeb1f0701a10adebdfc8bcb570efb72dc3f70491fc1184fceedc0e' 
  AND (
    token = 'c8OWDrwFkRvBb5yaLVrKvJzmk3TMTmc6ccrXK/IQL3c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034