UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qMteWrv8nubVSZKWANz1sC0Wxy2Uxs5+bKRlJxAZfwo=' 
WHERE 
  key_id = '19ce3bbf407e2da8915f2a3bf3500f2fbbc05c30758a2a07e1aa2f5866ef4327' 
  AND (
    token = 'qMteWrv8nubVSZKWANz1sC0Wxy2Uxs5+bKRlJxAZfwo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038