UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bo8TasXy2+c3/woSz/8PeYJUPKWrDU09vyZ4BvGKzpU='
WHERE
key_id = '0591ef72df303a8862b7eea46932a0bcafd0135a84965c189b9cddafb2e13995'
AND (
token = 'bo8TasXy2+c3/woSz/8PeYJUPKWrDU09vyZ4BvGKzpU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)