UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rpwHASQCralRw6h+L3FGYhfVU0ni2HUjgq8EYoZfdWU='
WHERE
key_id = 'c30d52d81858c15aed909e8e74b69d843e46e8cd30db8cd04e76469b5ce50bfb'
AND (
token = 'rpwHASQCralRw6h+L3FGYhfVU0ni2HUjgq8EYoZfdWU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)