UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qqa+VjiJrUPfNyKovYC0pzn+OO2BqoinV+5dDA10Kvk='
WHERE
key_id = '58f44f4c8847e6dc346f284a74ae01d91c5030d13d5ee42c9160582a1e617949'
AND (
token = 'Qqa+VjiJrUPfNyKovYC0pzn+OO2BqoinV+5dDA10Kvk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)