UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gSxQYFR72ImawQrJ9wwFN/dG+qf7+A/uu0+U+CVo0hU='
WHERE
key_id = '00ec23e4c0c58f4aa94204dee2e1d44ecc57e6194a4107336ea97a9fd495a74c'
AND (
token = 'gSxQYFR72ImawQrJ9wwFN/dG+qf7+A/uu0+U+CVo0hU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)