UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jOpsVm8nffPgPsMvYtSwEBekjqlkIgYUdnyDJf6m6Q0=' 
WHERE 
  key_id = '383ce8748818c3a07e8bf8e3b5191207876591f4c473f03e87ed298eabb0f5ea' 
  AND (
    token = 'jOpsVm8nffPgPsMvYtSwEBekjqlkIgYUdnyDJf6m6Q0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029