UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tUt7lIiugpscbCNmV5d6dB4v6U9R9SL/1zd8hSM5Kms='
WHERE
key_id = '8d030ace468f93848f81633a37b63000ef74aad7353a8aaf012e2dc27e69f03d'
AND (
token = 'tUt7lIiugpscbCNmV5d6dB4v6U9R9SL/1zd8hSM5Kms='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)