UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vO2O4VUR0axE+XPFwXYMA90J6Ij2UhmRPNvL5Woqdqk='
WHERE
key_id = '2cf0b1206bda5fba70200ade06ea41ecdd00f7503990de63eb2e6988ac3febb6'
AND (
token = 'vO2O4VUR0axE+XPFwXYMA90J6Ij2UhmRPNvL5Woqdqk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)