UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FeuwOGY7uAAa4UTC/wEK8PrTcgIyWMSGeNUHkspdKQs='
WHERE
key_id = 'c3b36a9905d91ea1c7af4efc6c8063f02cb8d4f2f5c1d7b41a99012eb29b54af'
AND (
token = 'FeuwOGY7uAAa4UTC/wEK8PrTcgIyWMSGeNUHkspdKQs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)