UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+Z7liNoaNsPxUjki+R4Wy3BoVs8WPhOAvzzSWNWouLA='
WHERE
key_id = '72aae4548b7b49f2da48ca451840eada2a57f0fc0280e1436ad8114dfcb8ac60'
AND (
token = '+Z7liNoaNsPxUjki+R4Wy3BoVs8WPhOAvzzSWNWouLA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)