UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FZfYIjPal9E1k6e679kshULlzPf1RP6XX1UNgbHGlv8='
WHERE
key_id = '3a967878ce709e2947a428b912f6dc33b68128b33f820493478c48bb3aa303fd'
AND (
token = 'FZfYIjPal9E1k6e679kshULlzPf1RP6XX1UNgbHGlv8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)