UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IJXnj10hsPCDAtBev9xPiMCOqSGX3qF56Zj/xHMjLyc=' 
WHERE 
  key_id = '7b325c1672451eda498dd46742f74f9f2e6bc805340ae41e7722477b92c89e4e' 
  AND (
    token = 'IJXnj10hsPCDAtBev9xPiMCOqSGX3qF56Zj/xHMjLyc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027