UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5P08nMgszJjBkQtskf1mrcinZ6KncjbqZBSmBnVVvXY='
WHERE
key_id = 'd54de11bcb0d18c48c5111caa84cd1cba69b3236556e2c24dab464a877626860'
AND (
token = '5P08nMgszJjBkQtskf1mrcinZ6KncjbqZBSmBnVVvXY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)