UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'evAfa+tAw3yIVHXMOMzrvv596ECIYJMRkX/GuhM0p6w=' 
WHERE 
  key_id = '630be9ee0d04bc7747e76204c103589b0ce7d3e7f1813704d1faa6b0f4c3ea71' 
  AND (
    token = 'evAfa+tAw3yIVHXMOMzrvv596ECIYJMRkX/GuhM0p6w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053