UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wWDcGZtVFnrXGqJh9ZOxHxS/Uun+4Pv5yS6Hw1/wHQA='
WHERE
key_id = 'fc77bf0931d541dbe44e7e9e2da31d63f011d85422a363b4ca506bfae4ea161c'
AND (
token = 'wWDcGZtVFnrXGqJh9ZOxHxS/Uun+4Pv5yS6Hw1/wHQA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)