UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4I/fkap2/v/B2JV/3BUain/ZYY0wr2+sZ+8UXBDZdQE=' 
WHERE 
  key_id = '9670c577754b04bf1b30dbffbae9211a4d10a34afd718267a26925b35d891e07' 
  AND (
    token = '4I/fkap2/v/B2JV/3BUain/ZYY0wr2+sZ+8UXBDZdQE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020