UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MmB/7W4E4kFcf5g3Ry1ziabj8hDvCciR6vITJShI6WM=' 
WHERE 
  key_id = '0947b59ac0f1e6f7f34b864b2b8c1fc874611f2afe1b0bd6edacf8b347d3a0b8' 
  AND (
    token = 'MmB/7W4E4kFcf5g3Ry1ziabj8hDvCciR6vITJShI6WM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022