UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+nmoNR+rmUc/l+Dbp0zM6HeNRY2yII40+UkkKwI1iVk='
WHERE
key_id = 'afbb5f1b7eb28db0b3b31de4cf9900a5256c1214c9e542838950213409a78bcf'
AND (
token = '+nmoNR+rmUc/l+Dbp0zM6HeNRY2yII40+UkkKwI1iVk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)