UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's2sOXPFygyfFa9veJzG3x83JsdU/OcWEzTU2D2zkFbk='
WHERE
key_id = 'c857208d4c8fd59dd38efac3fa32a842d1e54408a940f8665d5c7b1c54479ca7'
AND (
token = 's2sOXPFygyfFa9veJzG3x83JsdU/OcWEzTU2D2zkFbk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)