UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z7fS4r+No4/0tlRxNacs7D0b5pxIdYsAZjIbZf/maX0='
WHERE
key_id = 'b446a6407ee460e65056adee333cbddbd6c74e945e14bd886cf00cd2e4e15b3f'
AND (
token = 'z7fS4r+No4/0tlRxNacs7D0b5pxIdYsAZjIbZf/maX0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)