UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DPOvMJAkmlX9s0ddgBI38GeFx+f14lEf2XBALj81kH4=' 
WHERE 
  key_id = '8b1721920499912ca9f18df5f168f60b6ae7778f668d6d4d88c1f460217ef1e3' 
  AND (
    token = 'DPOvMJAkmlX9s0ddgBI38GeFx+f14lEf2XBALj81kH4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057