UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm6G/Y7oXL63wNqlNxhWRHkOpGm0In+WcZGYVBdEeiRw='
WHERE
key_id = '5f0b9d16269f0ce1b1ad212ae90173ede0fb47c9957986b8fdc7bdf766999446'
AND (
token = 'm6G/Y7oXL63wNqlNxhWRHkOpGm0In+WcZGYVBdEeiRw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)