UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xfvcqX7msGRMAQaou1hObJXnM9XXKoluOYid/1c8MzI='
WHERE
key_id = 'c46ae3cf5cbaccbbd4fe4d683679c529d9d083ba11ac1bd487a2e125969afeb7'
AND (
token = 'xfvcqX7msGRMAQaou1hObJXnM9XXKoluOYid/1c8MzI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)