UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7e5cYpbdUlLQE3mxRjSLSx/spduw+UWnQ5TFFMiRpYk='
WHERE
key_id = '5a6691026b437ecdd841b0b7d279096c183fb1b542d7655770a1d69756ccd478'
AND (
token = '7e5cYpbdUlLQE3mxRjSLSx/spduw+UWnQ5TFFMiRpYk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)