UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Ks3o21WOFPZOVth5nf8imv5oskuw+UWkEvDvmn4Gtw='
WHERE
key_id = '21b6e09f35cac57223fc9bda4186d7a25a912ecf8600252fa0b8f7f7b357d9d7'
AND (
token = '4Ks3o21WOFPZOVth5nf8imv5oskuw+UWkEvDvmn4Gtw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)