UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3jUmTjQIdIpX20AtXYUEbt1jB84vGO1aIQrdPBdie5I='
WHERE
key_id = '3bcbd620808f23f7933da6d023ff05c3dab5b9b0e67c948bb6e9bf956d95be0a'
AND (
token = '3jUmTjQIdIpX20AtXYUEbt1jB84vGO1aIQrdPBdie5I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)