UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1ZeqynDRRBwHUAwXN/WmUze729CNmakFlo1RGY9T+CY='
WHERE
key_id = 'b4487e29d3e5ccbf58155ba255f6e39df4fc532ddfd7bb046755fdc66465f7c2'
AND (
token = '1ZeqynDRRBwHUAwXN/WmUze729CNmakFlo1RGY9T+CY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)