UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GqDCRtjxKck23NFm9VnGeGza9wfuXITj6/94p4ZXvcg='
WHERE
key_id = 'a4291817ec84670fd2ae9d2ad794dd9d42033ad50808ea30f5f063b4a92b14d2'
AND (
token = 'GqDCRtjxKck23NFm9VnGeGza9wfuXITj6/94p4ZXvcg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)