UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4pjl6FGLsHrRGTEClqBwFijrYlRl0A+oz9mWebpqzqc='
WHERE
key_id = '4be2d68ee68ec4f928dec63ebd942813b5529216fddd50ee780807da62f2c596'
AND (
token = '4pjl6FGLsHrRGTEClqBwFijrYlRl0A+oz9mWebpqzqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)