UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LfH/u/iZ6Zsfv0eT3RdPqAFls54qsw9I5Kf1v/PC2KY='
WHERE
key_id = 'ca29557c1d7fdf10cb36fac68ecf615b203815b524335d234f22049b5ae5179a'
AND (
token = 'LfH/u/iZ6Zsfv0eT3RdPqAFls54qsw9I5Kf1v/PC2KY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)