UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '14POhgmHianAj3uTFFuH1JYDpfmaoHaqWZeObaVZr5U='
WHERE
key_id = '28a794609286c8083d8f44bfd3e10d37889f6e5eb3931b2d43635419601841d4'
AND (
token = '14POhgmHianAj3uTFFuH1JYDpfmaoHaqWZeObaVZr5U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)