UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vbDqxDdRszSVDxNdd6wchavLZGj3r7kbZdYEnlgTo68=' 
WHERE 
  key_id = '9fbe042caf4cf8347ce8d96aaedcc3ecc9f3ddf2b8cbf94938de43b5ac9f65b5' 
  AND (
    token = 'vbDqxDdRszSVDxNdd6wchavLZGj3r7kbZdYEnlgTo68=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022