UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JCmVMNU8r1jsecxfwHiEPmaxC5SdhSkchrjTBEehNV0=' 
WHERE 
  key_id = '112a4090ab47a89c7af8ffcbbdf9483853fd7197e1fcded851b94337a9fc8d81' 
  AND (
    token = 'JCmVMNU8r1jsecxfwHiEPmaxC5SdhSkchrjTBEehNV0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036