UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a/gu6SbJO4/2eXqadrrCuuvV3wnw/KZhozMgTzeRNf8='
WHERE
key_id = '6bb6476a5da15f5a04a805381eb3a3332ee1787972437dc023ba628d60112ba9'
AND (
token = 'a/gu6SbJO4/2eXqadrrCuuvV3wnw/KZhozMgTzeRNf8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)