UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iOFXo2Kdw//Ka0mOXTiztYzhK9rpuhCqWVOD2sYNMwo='
WHERE
key_id = 'f8fd7f76be4cbd122b471b483d313af9f7d14bcbad529f5175cfb5733bfbe9af'
AND (
token = 'iOFXo2Kdw//Ka0mOXTiztYzhK9rpuhCqWVOD2sYNMwo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)