UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xkmATAa6X0FN/zQfsKx5FZ83Jjq2qFEXyiq3483morY=' 
WHERE 
  key_id = '336ba3cf7aca107e836e0e7734e9f6658432380971cb7ac234a1cd07ac9483fe' 
  AND (
    token = 'xkmATAa6X0FN/zQfsKx5FZ83Jjq2qFEXyiq3483morY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020