UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bK5IOZUn0YY3+W6jWmI5vfwBs2xbmme4eb1VS8rFasM='
WHERE
key_id = '3c46dad320e5a4073c167ee4a5d0d0e3fec2c76a355b8fdfaf158c2f59c00ec5'
AND (
token = 'bK5IOZUn0YY3+W6jWmI5vfwBs2xbmme4eb1VS8rFasM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)