UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ReJS9ShugcpiR+idRhtOg83PA8zuNwlRbrrDIpcKGHg=' 
WHERE 
  key_id = '4ba7047f5ce1cfee7cf06dc9c0e0f9665771f232ee1b852b8be6901ceb5dea35' 
  AND (
    token = 'ReJS9ShugcpiR+idRhtOg83PA8zuNwlRbrrDIpcKGHg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021