UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j8bjjRY3dHpZGlMa8HhSUvN0m+iVEbVXWKBPxKDJBL4='
WHERE
key_id = '7e035e1c32dc40e813600feac65ea8548bb494b39bb8d18a3698388a567e73fb'
AND (
token = 'j8bjjRY3dHpZGlMa8HhSUvN0m+iVEbVXWKBPxKDJBL4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)