UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5VnGtzHNGcw8NEm6gDXbJSK1i5dVVZ88KCoHybP3XHA='
WHERE
key_id = 'df9952344dcf3a5f5300b60d91cf02ad480b9f97fad48b07d10c0b48e3b82c03'
AND (
token = '5VnGtzHNGcw8NEm6gDXbJSK1i5dVVZ88KCoHybP3XHA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)