UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yqKbnhJyVoyZu7fVdA4H7DdcwfLpg9UhbkMwWj0Y1PE='
WHERE
key_id = 'a44d28a5bdf14221c163092e0ee611a2af2829e9af61a0b3d222e2c881764c7f'
AND (
token = 'yqKbnhJyVoyZu7fVdA4H7DdcwfLpg9UhbkMwWj0Y1PE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)