UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RSHMg5u/AIfdXm35Aw8keziuowKYfETVLFn2HG8Iisc=' 
WHERE 
  key_id = '3231840eecb680c032d061f1eb851cd8ead2cd3ecbf34fc9065296288b205c13' 
  AND (
    token = 'RSHMg5u/AIfdXm35Aw8keziuowKYfETVLFn2HG8Iisc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046