UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c3uu2bHJiolRs8GisfAzovPSXUToIde4cpDW9Opq9gQ=' 
WHERE 
  key_id = '5e3dbb01cc090574a1db564aca1b8773656cef1558aef7f5a82f8204678fc04e' 
  AND (
    token = 'c3uu2bHJiolRs8GisfAzovPSXUToIde4cpDW9Opq9gQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029