UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ElqEPBDL+h8cM/H5esSl17qi2+ObjXtZ398eqfCyrZI='
WHERE
key_id = 'eb3657a1c507ec630fa2df116faa7194df9655c2e0ee583d653814a94877039c'
AND (
token = 'ElqEPBDL+h8cM/H5esSl17qi2+ObjXtZ398eqfCyrZI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)